﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://wubiyu.cnblogs.com">
<head>
	<title></title>
	<link href="../../Theme/DomExtGray/gray.min.css" rel="Stylesheet" type="text/css" />
	<link href="PageModel.css" rel="Stylesheet" type="text/css" />
	<script type="text/javascript" src="../../domExt.js"></script>
</head>
<body>
	<div class="fun_title">
		&lt;h:btn&gt;&lt;/h:btn&gt;标记
	</div>
	<j:layout>
      <div class="fun_content">
            描述：按钮标记。<br />
      </div>
      <div class="fun_title2">
            标签属性:
      </div>
      <div class="fun_content2">
           css：按钮的CSS样式<br />
           csshover：当鼠标移动到按钮上的CSS样式。<br />
           cssactive：按钮处于激活状态时的CSS样式。<br />
           cssactivehover：当鼠标移动到激活状态按钮时的CSS样式<br />
           isactive：是否是激活状态<br />
           keyevent：设置键盘事件，默认为：&nbsp; &quot;click&quot;<br />
           keygroup：设置键盘事件组，默认为：&quot;default&quot;<br />
           keychar：设置键盘事件的按键值，默认为：&quot;Enter&quot;【回车】，"Ctrl+Enter"，"Alt+Enter"，"SHIFT+Enter" 【注意，与浏览器键盘事件冲突】<br />
      </div>
        <div class="fun_title2">
            对象方法:
      </div>
       <div class="fun_content2">
           <span>Active([isactive])</span> ：将按钮设为激活状态。没有传入 isactive 时为false;<br />
      </div>		   
      <div class="fun_title2">
            示例预览:
      </div>
      <div class="code">
        <h:text></h:text>
		<h:btn id="btn1" onclick="run_click();">Button1</h:btn>
		<h:btn id="btn2" isactive="true" keychar="Enter">Button2</h:btn>
      </div>
         <br />
       <div class="fun_title2">
            示例代码:
      </div>
       <div class="code">
             Html code<br />
             &lt;h:btn id=&quot;btn1&quot; 
             onclick=&quot;run_click();&quot;&gt;Button1&lt;/h:btn&gt; &lt;h:btn id=&quot;btn2&quot; isactive=&quot;true&quot;&gt;Button2&lt;/h:btn&gt;<br />
             &lt;script type=&quot;text/javascript&quot;&gt;<br />
             &nbsp;&nbsp;&nbsp; function run_click()<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var btn2 = _g(&quot;#btn2&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(btn2.isactive == &quot;false&quot;)<br />
             &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
             btn2.Active(&quot;true&quot;); <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
             btn2.Active(&quot;false&quot;);//还可以写成 btn2.Acitve();<br />

&nbsp;&nbsp;&nbsp; }<br />
             &lt;/script&gt;</div>
      <script type="text/javascript">
      	function run_click() {
      		var btn2 = _g("#btn2");
      		if (btn2.isactive == "false")
      			btn2.Active("true");
      		else
      			btn2.Active("false");
      	}
      	_h.ready(function () {
      		var btn2 = _g("#btn2");
      		_h.addEvent(btn2, "click", function () { alert("btn2"); });
      	});
            
      </script>
</body>
</html>
